import request from "@/utils/request";

/**
 * OrderDetails ——> 实体大驼峰
 * orderDetails ——> 实体小驼峰
 * 订单明细 ——> 实体中文名
 * bg-print ——> 服务名
 */

/**
 * 查询OrderDetails分页列表
 */
export function getOrderDetailsPageList(params) {
    return request.get(
        "/orderdetails/list",
        {params}
    );
}

/**
 * 根据id查询orderdetails
 */
export function getOrderDetailsById(id) {
    return request.get(
        `/orderdetails/info/${id}`
    );
}

/**
 * 根据订单id查询对应的所有材料以及模型
 */
export function getOrderDetailsListByOrderId(orderId) {
    return request.get(
        `/orderdetails/list/${orderId}`
    );
}


/**
 * 新增orderdetails
 */
export function createOrderDetails(data) {
    return request.post(
        "/orderdetails/save",
        data
    );
}


/**
 * 修改orderdetails
 */
export function updateOrderDetails(data) {
    return request.put(
        "/orderdetails/update",
        data
    );
}


/**
 * 批量删除orderdetails
 * delete传body参数需要使用config将data传递进去
 */
export function deleteOrderDetailsBatchByIds(data) {
    return request.delete(
        "/orderdetails/delete",
        {data}
    );
}
